package com.qimo.service.Impl;

import com.qimo.dao.ItemDao;
import com.qimo.model.IndexShoppingListItem;
import com.qimo.model.Item;
import com.qimo.service.ItemService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("itemService")
public class ItemServiceImpl implements ItemService {

    @Resource
    private ItemDao itemDao;

    public List<IndexShoppingListItem> IndexItemList(String ISBN, String typeName, String shopName, String itemName,int page) {
        System.out.println(ISBN+typeName+shopName+itemName+page);
        return this.itemDao.IndexItemList(ISBN,typeName,shopName,itemName,(page-1)*8);
    }

    public Item ItemItem(int itemId) {
        System.out.println("传来的itemID:"+itemId);
        return this.itemDao.ItemItem(itemId);
    }

    public int IndexItemListCount(String ISBN, String typeName, String shopName, String itemName) {
        return this.itemDao.IndexItemListCount(ISBN,typeName,shopName,itemName);
    }

}
